{literal}
<a href="#" onclick='return checkboxState(true)'>Select All</a> | <a href="#"  onclick='return checkboxState(false)'>Select None</a>
<script>
	function checkboxState(state){
		$("INPUT[type='checkbox']").attr('checked', state);
	
		return false;
	}
</script>
{/literal}
<form method="POST" action='/admin/permissions/saveall/'>
{foreach from=$actions item=action key=cid}
<table border=1 class="contentTable">
	<tr>
		<td colspan='3' height="20">Controller: <strong>{$action->module_name} - {$action->module_description}</strong></td>
	</tr>
	{if $action->actions}
	<tr class="table_head">
		<td width="200">Action</td>
		<td width="100">Allow</td>
		<td>Description</td>
	</tr>
	{foreach from=$action->actions item=subaction}
		<tr bgcolor="{if $subaction->perm}#79A3C1{else}{cycle values='#ffffff,#eeeeee'}{/if}">
			<td>{$subaction->module_name}</td>
			<td><input type='checkbox' name='actions[{$subaction->module_id}]' {if $subaction->perm}checked="true"{/if}/></td>
			<td>{$subaction->module_description}</td>			
		</tr>
	{/foreach}
	{else}
		<tr>
			<td colspan="3"><i>List is empty</i></td>
		</tr>	
	{/if}
	
</table>
{/foreach}
<br/>
<input type="hidden" name="user_group_id" value="{$user_group_id}" />
<input type="hidden" name="module_id" value="{$module_id}" />
<input type="submit" value="Save" style="width:100px"/>
</form>